/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trocabi.Socle;

import javax.swing.JTable;
import javax.swing.table.TableColumnModel;

/**
 *
 * @author philippe
 */
public class SwingTools {
     public static void setJTableSize(JTable jtable, int[] colSize) {
        TableColumnModel columnModel = jtable.getColumnModel();

        for (int i = 0; i < columnModel.getColumnCount(); i++) {
            columnModel.getColumn(i).setPreferredWidth(colSize[i]);
            columnModel.getColumn(i).setResizable(false);
        }
    }
}
